// JavaScript Document
var xmlhttp;
function AJAX(url){
	xmlhttp=null;
	if (window.XMLHttpRequest){// code for all new browsers
	  	xmlhttp=new XMLHttpRequest();
	}else if (window.ActiveXObject){// code for IE5 and IE6
	  	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null){
	  	xmlhttp.onreadystatechange=state_Change;
	  	xmlhttp.open("GET",url,true);
	  	xmlhttp.send(null);
	}else{
	  alertMsg("你的浏览器不支持XMLHTTP对象。");
	}
}
function state_Change(){
	if (xmlhttp.readyState==4){// 4 = "异步请求成功"
		if (xmlhttp.status==200){// 200 = OK
			var o = document.getElementById("box");
			var str = xmlhttp.responseText;
			o.innerHTML = str;
		}else{
			//alert("服务器出错，异步请求失败！");
			alertMsg("服务器出错，异步请求失败！");
		}
	}
}


/*另外一个*/
var xmlhttpA;
function AJAX1(url){
	xmlhttpA=null;
	if (window.xmlhttpARequest){// code for all new browsers
	  	xmlhttpA=new xmlhttpARequest();
	}else if (window.ActiveXObject){// code for IE5 and IE6
	  	xmlhttpA=new ActiveXObject("Microsoft.xmlhttpA");
	}
	if (xmlhttpA!=null){
	  	xmlhttpA.onreadystatechange=state_ChangeA;
	  	xmlhttpA.open("GET",url,true);
	  	xmlhttpA.send(null);
	}else{
	  alertMsg("你的浏览器不支持xmlhttp对象。");
	}
}
function state_ChangeA(){
	if (xmlhttpA.readyState==4){// 4 = "异步请求成功"
		if (xmlhttpA.status==200){// 200 = OK
			var oA = document.getElementById("box1");
			var strA = xmlhttpA.responseText;
			oA.innerHTML = strA;
		}else{
			alertMsg("服务器出错，异步请求失败！");
		}
	}
}